package com.example.live.api

import com.example.http.CommonHttpRetrofitAnnotation
import com.example.http.HttpManager
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import javax.inject.Singleton

@Module //声明为Hilt模块
@InstallIn(SingletonComponent::class) //声明当前模块可以在应用内注入对象
object LiveServerModule {

    @Provides //提供统一实现
    @Singleton //声明为单例
    fun getLiveServerApi(@CommonHttpRetrofitAnnotation retrofit: Retrofit): LiveServerApi = retrofit.create(LiveServerApi::class.java)

}